package com.example.module_web.view.fragment;


import com.example.module_web.R;
import com.example.module_web.adapter.GridViewAdapter;
import com.example.module_web.base.BaseFragment;
import com.example.module_web.beans.Result;
import com.example.module_web.databinding.WebFragmentPictureBinding;
import com.example.module_web.viewmodule.NetData_Web;

/**
 * Created by admin on 2018/1/22.
 */

public class Fragment_30 extends BaseFragment<WebFragmentPictureBinding> {
    private WebFragmentPictureBinding mBinding;
    private String[] picurl;
    @Override
    public int setLayoutId() {
        return R.layout.web_fragment_picture;
    }
    @Override
    public void init(WebFragmentPictureBinding binding) {
        this.mBinding=binding;
        NetData_Web.getInstance().getPicture(getContext().getApplicationContext(), "ActiviteImage", new NetData_Web.Singer<Result>() {
            @Override
            public void success(Result s) {
                picurl=s.getResult().split("\\+");
                GridViewAdapter gridAdapter=new GridViewAdapter(getContext(),picurl,true,R.layout.web_item_picture_fragment,getFragmentManager());
                mBinding.gridPicture.setAdapter(gridAdapter);
            }

            @Override
            public void failed(String s) {

            }
        });
    }
}
